<template>
  <div class="record-signing">
    <div class="waite-signing">
    <div class="title">待处理签约</div>
    <br />
    <div class="signed">
      <el-form :inline="true" :model="formInline" class="demo-form-inline">
        <el-row :gutter="20">
          <el-col :span="6">
            <el-form-item label="签约状态">
              <el-select v-model="formInline.region" placeholder="请选择">
                <el-option label="请选择" value="请选择" />
                <el-option label="待审核" value="待审核" />
                <el-option label="待支付" value="待支付" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="签约机构">
              <el-select v-model="formInline.region" placeholder="请选择">
                <el-option label="请选择" value="shanghai" />
                <el-option label="待审核" value="shanghai" />
                <el-option label="待支付" value="beijing" />
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="医生团队">
              <el-select v-model="formInline.region" placeholder="请选择">
                <el-option label="请选择" value="shanghai" />
                <el-option label="待审核" value="shanghai" />
                <el-option label="待支付" value="beijing" />
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-button type="primary" plain>导出</el-button>
          </el-col>
        </el-row>

        <el-row :gutter="20">
          <el-col :span="6">
            <el-form-item label="医生团队">
              <el-select v-model="formInline.region" placeholder="请选择">
                <el-option label="请选择" value="shanghai" />
                <el-option label="待审核" value="shanghai" />
                <el-option label="待支付" value="beijing" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="选择日期">
              <el-date-picker
                v-model="value2"
                class="length"
                type="datetimerange"
                :shortcuts="shortcuts"
                range-separator="~"
                start-placeholder="请输入日期"
                end-placeholder="请输入日期"
              />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-input placeholder="请输入关键字" />
          </el-col>
        </el-row>
      </el-form>
    </div>
    <!-- 表格 -->
    <div class="tb">
      <el-table :data="tableData" style="width: 100%">
        <el-table-column type="selection" width="30" />
        <el-table-column fixed prop="number" label="编号" width="120" />
        <el-table-column prop="name" label="签约人姓名" width="100" />
        <el-table-column prop="id" label="身份证号" width="170" />
        <el-table-column prop="mobile" label="手机号码" width="120" />
        <el-table-column prop="state" label="签约状态" width="80" />
        <el-table-column prop="team" label="签约医生团队" width="110" />
        <el-table-column prop="serve" label="签约服务包" width="110" />
        <el-table-column prop="time" label="最后修改时间" width="120" />
        <el-table-column fixed="right" label="操作" width="120">
          <template #default>
            <el-button link type="primary" size="small" @click="handleClick"
              >查看详情</el-button
            >
            <el-button link type="primary" size="small" @click="redact">续约</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
  </div>
</template>

<script lang="ts" setup>
  import { reactive } from "vue";
import { ref } from "vue";
import { useRouter, useRoute } from 'vue-router'
import { Search } from "@element-plus/icons-vue";
const formInline = reactive({
  user: "",
  region: "",
});
const router = useRouter()
const onSubmit = () => {
  console.log("submit!");
};
const value2 = ref("");

const shortcuts = [
  {
    text: "上周",
    value: () => {
      const end = new Date();
      const start = new Date();
      start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
      return [start, end];
    },
  },
  {
    text: "上个月",
    value: () => {
      const end = new Date();
      const start = new Date();
      start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
      return [start, end];
    },
  },
  {
    text: "最近三个月",
    value: () => {
      const end = new Date();
      const start = new Date();
      start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
      return [start, end];
    },
  },
];
const input2 = ref("");

const handleClick = () => {
 router.push('/signing-management/particulars')
}
const redact = () => {
 router.push('/signing-management/redact')
}


const tableData = [
  {
    number: '2021340001',
    name: '王安然',
    id: '371456198908090543',
    mobile: '188641368888',
    state: '待审核',
    team: '李明明团队',
    serve: '老年人服务包',
    time: '2020/10/09',
  },
  {
    number: '2021340001',
    name: '王安然',
    id: '371456198908090543',
    mobile: '188641368888',
    state: '待审核',
    team: '李明明团队',
    serve: '老年人服务包',
    time: '2020/10/09',
  },
  {
    number: '2021340001',
    name: '王安然',
    id: '371456198908090543',
    mobile: '188641368888',
    state: '待审核',
    team: '李明明团队',
    serve: '老年人服务包',
    time: '2020/10/09',
  },
  {
    number: '2021340001',
    name: '王安然',
    id: '371456198908090543',
    mobile: '188641368888',
    state: '待审核',
    team: '李明明团队',
    serve: '老年人服务包',
    time: '2020/10/09',
  },
  {
    number: '2021340001',
    name: '王安然',
    id: '371456198908090543',
    mobile: '188641368888',
    state: '待审核',
    team: '李明明团队',
    serve: '老年人服务包',
    time: '2020/10/09',
  },
  
]
</script>

<style lang="less" scoped>
  .signed {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}
.block {
  padding: 30px 0;
  text-align: center;
  border-right: solid 1px var(--el-border-color);
  flex: 1;
}
.block:last-child {
  border-right: none;
}
.block .demonstration {
  display: block;
  color: var(--el-text-color-secondary);
  font-size: 14px;
  margin-bottom: 20px;
}

.el-table__header-wrapper {
  margin-right: auto;
  margin-left: auto;
}
</style>
